<%@ page import="domain.student" %>
<%@ page import="java.util.List" %>
<%--
  Created by IntelliJ IDEA.
  User: 76053
  Date: 2020/3/16
  Time: 14:30
  To change this template use File | Settings | File Templates.
--%>

<%--冯伟    易慧   鲁泽--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%--核心标签库--%>
<html>
<head>
    <title>连接数据库</title>
    <style type="text/css">
        td{
            border: 1px solid blue;
        }

    </style>
</head>
<body>
<table>
    <tr>
        <td>学号</td>
        <td>姓名</td>
        <td>籍贯</td>
        <td>账户名</td>
        <td>密码</td>
        <td>删除</td>
        <td>分组信息</td>
    </tr>

    <%--list里面存放的就是student对象--%>
    <c:forEach items="${list}" var="student" varStatus="ck">
        <%--我要隔行变色--%>
        <tr  <c:if test="${ck.count%2==0}">bgcolor="red"</c:if> bgcolor="blue">
        <td>${student.s_id}</td>
        <td>${student.s_name}</td>
        <td>${student.s_home}</td>
        <td>${student.s_user}</td>
        <td>${student.s_password}</td>
        <td>${student.studentgroup.s_groupname}</td>
        <td>点我删除</td>
        </tr>
    </c:forEach>

    <form action="/admin.do">
        <tr><td>查询条件</td></tr>
        <tr><td><span>分组查询</span>
        <select name="fzid">
            <option value="">...</option>
            <c:forEach items="${studentG}" var="stugp" varStatus="vs">
                <option value="${stugp.s_groupid}" <c:if test="${fzid==stugp.s_groupid}">selected</c:if>> ${stugp.s_groupname}</option>
            </c:forEach>
        </select>
        </td></tr>
        <tr>
            <td>
                <span>姓名</span>
                <input  type="text" name="studentname" value="${studentname}">
            </td>
        </tr>
        <tr><td><input type="submit" value="点我提交"></td></tr>


    </form>

    <%--
        for(student  student:items){
                sout(student.gets_id())
        }

    --%>
      <%--  ${list}  &lt;%&ndash;通过el表达式取出list集合&ndash;%&gt;--%>


</table>
</body>
</html>
